<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@tag pageEncoding="UTF-8" isELIgnored="false"  %>
<style>
    .content i{
        color: #393D49;
        cursor: pointer;
    }

    .content i:hover{
        color: #1E9FFF;
    }
</style>
<div class="layui-inline selectProviderDiv" style="margin-bottom: 4px;">
    <input type="hidden" name="providerId">

    <div class="label">供应商</div>
    <div style="display: inline-block;width: 160px;">
        <div style="position: relative">
            <input type="text" name="provider" class="layui-input" lay-verify="provider" lay-filter="provider"  readonly style="padding-right: 30px;">
            <div style="position: absolute;top: 10px; right: 10px;">
                <i class="layui-icon layui-icon-more" id="selectProvider"></i>
            </div>
        </div>
    </div>

    <script>
        get("${baseUrl}provider/provider/getDefault.action", function (res) {
            if (res.code == 1){
                $("[name='provider']").val(res.data.name);
                $("[name='providerId']").val(res.data.id);
            }
        });

        $("#selectProvider").click(function () {
            openBigHtmlDialog("选择供应商", "${baseUrl}select/selectProvider.action");
        });

        function getSelectProvider(data) {
            $("[name='provider']").val(data.name);
            $("[name='providerId']").val(data.id);
            $(window).focus();

            try {
                if(typeof providerChange === "function") { //是函数    其中 FunName 为函数名称
                    providerChange(data.id);
                }
            } catch(e) {}
        }
    </script>
</div>